package inner_class;
@FunctionalInterface
interface FuncInterface {
    void test();
}
public class LambdaTest {
    public static void main(String[] args) {
        // 匿名内部类
        fun(new FuncInterface() {
            @Override
            public void test() {
                System.out.println("匿名内部类实现了FuncInterface接口");
            }
        });
        fun(() -> {
            System.out.println("Lambda表达式实现了FuncInterface接口");
        });
    }
    public static void fun(FuncInterface fi) {
        fi.test();
    }
}
